variable "vpc_name" {
  default = "huaweicloud_vpc_xxn"
}

variable "vpc_cidr" {
  default = "192.168.0.0/16"
}

resource "huaweicloud_vpc" "vpc_with_tags" {
  name = var.vpc_name
  cidr = var.vpc_cidr

  tags = {
    foo = "bar"
    key = "value"
  }
}

resource "huaweicloud_vpc_subnet" "subnet" {
    name    = "test_subnet"  
    cidr       =  "192.168.8.0"
    gateway_ip = "10.0.12.234"
    vpc_id     = huaweicloud_vpc.vpc_with_tags.id

}